<% has_contexts = !current_user.contexts.empty? -%>
<h1><%= I18n.t 'integrations.title' %></h1>
<p><%= raw I18n.t 'integrations.intro', documentation_link: link_to(I18n.t('integrations.developer_documentation_link'), url_for(:action => 'rest_api')) %></p>
<br/><p><%= I18n.t 'integrations.contents_header' %></p>
<ul>
  <li><a href="#email-cron-section"><%= I18n.t 'integrations.sections.automatic_email' %></a></li>
  <li><a href="#todo_rich_message_format"><%= I18n.t 'integrations.sections.email_rich' %></a></li>
</ul>
<p><%= raw I18n.t 'integrations.add_your_own', tell_us_link: link_to(I18n.t('integrations.tell_us_link_text'), 'https://github.com/TracksApp/tracks/issues') %></p>

<a name="email-cron-section"> </a>
<h2><%= I18n.t 'integrations.sections.automatic_email' %></h2>

<p><%= I18n.t 'integrations.cron_1' %></p>

<textarea id="cron" name="cron">0 5 * * * /usr/bin/curl -0 "<%= root_url %>todos.txt?due=6&token=<%= current_user.token %>" | /usr/bin/mail -e -s '<%= I18n.t 'integrations.cron_email_subject' %>' youremail@example.com</textarea>

<p><%= raw I18n.t 'integrations.cron_2', feeds_link: link_to(I18n.t('integrations.feeds_link_text'), feeds_path) %></p>

<a name="todo_rich_message_format"> </a>
<h2><%= I18n.t 'integrations.sections.email_rich' %></h2>
<p><%= I18n.t 'integrations.email_rich.description' %></p>
<pre><%= I18n.t 'integrations.example_names.todo' %> @<%= I18n.t 'integrations.example_names.context' %> ~<%= I18n.t 'integrations.example_names.project' %> &lt;131012 &gt;131009 #<%= I18n.t 'integrations.example_names.tag.1' %> #<%= I18n.t 'integrations.example_names.tag.2' %> *</pre>
<p><%= I18n.t 'integrations.email_rich.fields_title' %></p>
<table>
  <tr>
    <th><%= I18n.t 'integrations.email_rich.symbol_title' %></th><th><%= I18n.t 'integrations.email_rich.meaning_title' %></th>
  </tr>
  <tr>
    <td>@</td><td><%= I18n.t 'integrations.email_rich.field_descriptions.context' %></td>
  </tr>
  <tr>
    <td>~</td><td><%= I18n.t 'integrations.email_rich.field_descriptions.project' %></td>
  </tr>
  <tr>
    <td>&lt;</td><td><%= I18n.t 'integrations.email_rich.field_descriptions.due_date' %></td>
  </tr>
  <tr>
    <td>&gt;</td><td><%= I18n.t 'integrations.email_rich.field_descriptions.tickler_date' %></td>
  </tr>
  <tr>
    <td>#</td><td><%= I18n.t 'integrations.email_rich.field_descriptions.tag' %></td>
  </tr>
  <tr>
    <td>*</td><td><%= I18n.t 'integrations.email_rich.field_descriptions.star' %></td>
  </tr>
</table>
<p><%= I18n.t 'integrations.email_rich.fields_instruction' %>
